package com.skydonkey.dao;
import com.skydonkey.pojo.po.VideosWatchTimes;
import org.apache.ibatis.annotations.*;

@Mapper
public interface VideosWatchTimesMapper {
    @Select("SELECT * FROM videos_watch_times WHERE video_id = #{videoId}")
    VideosWatchTimes findByVideoId(@Param("videoId") Long videoId);

    @Insert("INSERT INTO videos_watch_times (video_id, watch_times) VALUES (#{videoId}, #{watchTimes})")
    void insert(VideosWatchTimes videosWatchTimes);

    @Update("UPDATE videos_watch_times SET watch_times = #{watchTimes} WHERE video_id = #{videoId}")
    void update(VideosWatchTimes videosWatchTimes);

    @Delete("DELETE FROM videos_watch_times WHERE video_id = #{videoId}")
    void deleteByVideoId(@Param("videoId") Long videoId);

}
